{% extends "admin/base.html" %}
{% block hscript %}
	<script type="text/javascript" src="themes/{{site.theme}}/style/jquery.min.js"></script>
    <script type="text/javascript" src="themes/{{site.theme}}/style/jquery.form.js"></script>
{% endblock %}

{% block nav %}
			<a href="?a=Index&d=infoBlog" title="website info">Web info</a>
{% endblock %}

{% block content %}	
	<div id="m_admin">
        <form id="blogForm" method="post" action="?a=Index&d=updateBlog">
            <div class="wrap">
            <h2>Site information for this Blog</h2>

            <table class="form-table">
                 <tr valign="top">
                <th scope="row">Blog Title:</th>
                <td><input type="text" size="45" value="{{blog.title}}"  id="title" name="title"/></td>
                </tr>

                <tr valign="top">
                <th scope="row">Sub Title:</th>
                <td><input type="text" size="45" value="{{blog.subtitle}}" style="width: 95%;" id="subtitle" name="subtitle" />
                <br/>
                In a few words, explain what this blog is about.</td>
                </tr>
                
                <tr valign="top">
                <th scope="row">Keywords:</th>
                <td><input type="text" size="45" value="{{blog.keywords}}" style="width: 95%;" id="keywords" name="keywords" />
                </td>
                </tr>
                
                <tr valign="top">
                <th scope="row">Description:</th>
                <td><input type="text" size="45" value="{{blog.description}}" style="width: 95%;" id="description" name="description" />
                </td>
                </tr>
                
                  <tr valign="top">
                <th scope="row">Url:</th>
                <td><input type="text" size="45" value="{{blog.url}}"  id="domain" name="url" />
               </td>
                </tr>

            	 <tr valign="top">
                <th scope="row">Theme:</th>
                <td>
                    <select  id="theme" name="theme" >
                    {% for theme in themes %}
                    	<option value="{{theme}}" {% if blog.theme|equal:theme %} selected='selected'{% endif %}>{{theme}}</option>
                    {% endfor %}
                    </select>
               </td>
                </tr>
                
                <tr valign="top">
                <th scope="row">Version:</th>
                <td><input type="text" size="45" value="{{blog.version}}"  id="version" name="version" />
               </td>
                </tr>

            </table>
           
			<p class="submit"><input type="submit" value="Save Changes" name="Submit"/></p>

  		</div>

        </form>
    </div>
{% endblock %}
    
{% block bscript %}    
<script type="text/javascript">
    $(document).ready(function() { 
    	var options = {
    	    	dataType: 'json',
    	    	success : function(data) {
	    				var hmd = $("#hiddenMessage");
	    				if (data.type == "error") {
	    					hmd.html("<div class='error'>" + data.message + "</div>");
	    				} else {
	    					hmd.html("<div class='info'>" + data.message + "</div>");
	    				}
	    				hmd.show().focus();
    				},
    	};
    	$("#blogForm").ajaxForm(options);
    });
</script>    
{% endblock %}